package com.sgb.kjwl.viewmodel.manage;

import android.app.Application;
import android.content.Context;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;

import com.sgb.kjwl.api.APIManager;
import com.sgb.kjwl.model.entity.manage.AgentStaffCheckEntity;
import com.sgb.kjwl.view.event.self.AgentApplyEvent;
import com.sgb.kjwl.view.ui.activity.manage.special.SpecialMenberNewDetailActivity;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.event.EventConstant;
import com.swgk.core.util.MToast;

import org.greenrobot.eventbus.EventBus;

import java.util.HashMap;
import java.util.Map;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class SpecialMenBerNewDetailModel extends AndroidViewModel {
    public SpecialMenBerNewDetailModel(@NonNull Application application) {
        super(application);
    }
    public void auditDetail(SpecialMenberNewDetailActivity activity, String id){
        APIManager.getInstance().getUserAPI().auditDetail(id).enqueue(new Callback<BaseEntity<SpecialMenberDetailBean>>() {
            @Override
            public void onResponse(Call<BaseEntity<SpecialMenberDetailBean>> call, Response<BaseEntity<SpecialMenberDetailBean>> response) {
                if (response.body()!=null){
                    if (response.body().isSuccess()){
                        activity.setview(response.body().getData());
                    }
                }
            }

            @Override
            public void onFailure(Call<BaseEntity<SpecialMenberDetailBean>> call, Throwable t) {

            }
        });
    }
}
